//
//  AcountViewController.m
//  Kids
//
//  Created by tengfei on 14/11/22.
//  Copyright (c) 2014年 90's Technology Co.Ltd. All rights reserved.
//

#import "AcountViewController.h"
#import "AccountInfo.h"
#import "ChangePasswordViewController.h"
@interface AcountViewController ()

@end

@implementation AcountViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.tableView.backgroundColor = [UIColor colorWithRed:0xf5 / 255.0 green:0xf0 / 255.0 blue:0xeb / 255.0 alpha:1.0];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
}
- (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section
{
    return 40;
}

- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
    if (indexPath.section == 0 && indexPath.row == 0) {
        UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"mobile" forIndexPath:indexPath];
        cell.detailTextLabel.text = [AccountInfo shareInstance].phone;
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }
    if (indexPath.section == 0 && indexPath.row == 1) {
        UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"changepassword" forIndexPath:indexPath];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }
    return nil;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if(indexPath.row==1){
        ChangePasswordViewController * changeViewController = [[ChangePasswordViewController alloc]init];
        changeViewController.phoneNumber = [AccountInfo shareInstance].phone;
        [self.navigationController pushViewController:changeViewController animated:YES];
    }
}
@end
